]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/texture-cache: Make key g_autofree
authorIvan Molodetskikh <yalterz@gmail.com>
Tue, 5 Jan 2021 13:40:15 +0000 (16:40 +0300)
committerIvan Molodetskikh <yalterz@gmail.com>
Tue, 5 Jan 2021 13:50:59 +0000 (16:50 +0300)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1558>

src/st/st-texture-cache.c

index ac4db8f86cac3b1db673b5fc31995f0ef2d62f82..744acd509f65f5bd1679bc6376aaad895d782471 100644 (file)
@@ -971,7 +971,7 @@ st_texture_cache_load_gicon (StTextureCache    *cache,
   ClutterActor *actor;
   gint scale;
   char *gicon_string;
-  char *key;
+  g_autofree char *key = NULL;
   float actor_size;
   GtkIconTheme *theme;
   GtkIconInfo *info;
@@ -1050,7 +1050,6 @@ st_texture_cache_load_gicon (StTextureCache    *cache,
     {
       /* If there's an outstanding request, we've just added ourselves to it */
       g_object_unref (info);
-      g_free (key);
     }
   else
     {
@@ -1058,7 +1057,7 @@ st_texture_cache_load_gicon (StTextureCache    *cache,
 
       request->cache = cache;
       /* Transfer ownership of key */
-      request->key = key;
+      request->key = g_steal_pointer (&key);
       request->policy = policy;
       request->colors = colors ? st_icon_colors_ref (colors) : NULL;
       request->icon_info = info;